import type { RouteRecordRaw } from 'vue-router';

import type { Component } from '../hooks/types';

export interface RouteMeta {
  // title
  title: string;
  // icon on tab
  icon?: string;
}

/**
 * Omit 用于剔除某个属性
 */
// @ts-ignore
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
  name: string;
  meta: RouteMeta;
  component?: Component | string;
  components?: Component;
  children?: AppRouteRecordRaw[];
  fullPath?: string;
  hidden?: boolean;
  path?: string;
}
export interface MenuTag {
  type?: 'primary' | 'error' | 'warn' | 'success';
  content?: string;
  dot?: boolean;
}

export interface Menu {
  name: string;

  icon?: string;

  path: string;

  disabled?: boolean;

  children?: Menu[];

  meta?: Partial<RouteMeta>;
}

export interface MenuModule {
  orderNo?: number;
  menu: Menu;
}


// export type AppRouteModule = RouteModule | AppRouteRecordRaw;
export type AppRouteModule = AppRouteRecordRaw;
